<template>
    <div class="btn">
        <button @click="onButtonClick">Hello Cesium</button>
    </div>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue'
import {useVueCesium} from 'vue-cesium'
import type { VcViewerProvider,VcReadyObject } from 'vue-cesium/es/utils/types.js';

const $vc:VcViewerProvider = useVueCesium();

const onButtonClick = ()=>{
    console.log($vc.viewer);
    $vc.creatingPromise.then((readyObj:VcReadyObject)=>{
        console.log(readyObj.viewer);
    })
}

</script>

<style lang="scss" scoped>
.btn{
    position: absolute;
    z-index: 2;
    top:200px;
    left:20px;
}
</style>